<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01-案例在末尾添加节点</title>
    <style type="text/css">
        div{
            width:200px;
            height:auto;
            border:2px solid red;
        }
    </style>
</head>
<body>
<div>
    <ul id="ulid">
        <li>111</li>
        <li>222</li>
        <li>333</li>
        <li>444</li>
    </ul>
</div>


</div>
<br/>
<input type="button" value="add" onclick="add1();"/>
<script type="text/javascript">
    function add2() {
        var div1 = document.getElementById("div1");
        var ul1 = document.getElementById("ulid");
        div1.appendChild(ul1);
    }


    function add1() {
        var ul1 = document.getElementById("ulid");
        var li1 = document.createElement("li");
        var tex1 = document.createTextNode("5555");
        li1.appendChild(tex1);
        ul1.appendChild(li1);
    }
    /*==========*/
    var myLi = document.createElement("li");
      var myUl = document.getElementById("ulid");

    var text = document.createTextNode("新增的文本内容");

    myLi.appendChild(text);
    myUl.appendChild(myLi)

</script>
</body>
</html>